package com.zjxf.repository;

import com.zjxf.base.bean.po.UmsAdmin;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.Optional;

/**
 * 管理员用户repository
 *
 * @author ZhangWei
 * @date 2021/3/26/026 19:03
 */
@Repository
public interface UmsAdminRepository extends JpaRepository<UmsAdmin, Long>, JpaSpecificationExecutor<UmsAdmin> {

    /**
     * 根据id与删除状态查找
     * @param id
     * @param deleteState
     * @return
     */
    Optional<UmsAdmin> findByIdAndDeleteState(Long id, Integer deleteState);

    /**
     * 根据姓名与删除状态查找
     * @param username
     * @param deleteState
     * @return
     */
    Optional<UmsAdmin> findByUsernameAndDeleteState(String username, Integer deleteState);
}
